local xingpao_active = fk.CreateSkill{
  name = "#lb__xingpao_active",
}

local LB_U = require "packages.lb_kill_utility.utility"

Fk:loadTranslationTable{
  ["#lb__xingpao_active"] = "星炮",
}

xingpao_active:addEffect("active", {
  interaction = function(self, player)
    local t = {}
    for i = 1, 3, 1 do
      table.insert(t,"lb__xingpao_"..i)
    end
    return LB_U.CheckBox {
      choices = t,
      max_num = #player:getCardIds("he"),
    }
  end,
  card_filter = function (self, player, to_select, selected)
    if self.interaction.data and #self.interaction.data > 0 then
      return #self.interaction.data > #selected and not player:prohibitDiscard(to_select)
    end
    return false
  end,
  target_filter = Util.FalseFunc,
  feasible = function (self, player, selected, selected_cards)
    if self.interaction.data and #self.interaction.data > 0 then
      return  #self.interaction.data == #selected_cards
    end
    return false
  end,
})

return xingpao_active
